import requestApi from "../../../../utils/request"
Page({
  data: {
    list: [],
  },
  async init() {
    try {
      requestApi.get('shopro/category/index').then(res => {
        this.setData({
          list: res.data.children,
        });
      })
    } catch (error) {
      console.error('err:', error);
    }
  },

  onShow() {
  },
  onChange(e) {
    const { id } = e.detail.item
    wx.navigateTo({
      url: '/service/shoppingMall/Goods/list/index?classId=' + id,
    });
  },
  onLoad() {
    this.init(true);
  },
});
